<?php


namespace app\admin\controller\general;
use app\admin\controller\Controller;
use app\admin\model\admin\User as AdminUserModel;
class Profile extends Controller
{
    /**
     * 代理商列表
     * @return mixed
     * @throws \think\exception\DbException
     */
    public function index()
    {

        $model = AdminUserModel::detail($this->admin['user']['id']);
        if ($this->request->isAjax()) {
            if ($model->renew($this->postData('user'))) {
                return $this->renderSuccess('更新成功');
            }
            return $this->renderError($model->getError() ?: '更新失败');
        }
        return $this->fetch('index', compact('model'));
    }
}